package com.cloud.quickcore.admin.dto;

import com.cloud.quickcommon.biz.BaseBizConvert;
import com.cloud.quickcore.admin.entity.SysPermission;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * 菜单资源--前端交互Dto
 *
 * @author NiJo_H
 * @version 1.0
 * @date 2019/8/13 21:03
 */
@Data
public class PermissionDto implements BaseBizConvert<SysPermission> {
    @ApiModelProperty(value = "资源名称", required = true)
    private String name;

    @ApiModelProperty(value = "资源字符串(用户控制权限)")
    private String code;

    @ApiModelProperty(value = "菜单or资源 1:菜单 2:资源")
    private Integer resourceType;

    @ApiModelProperty(value = "资源url")
    private String url;

    @ApiModelProperty(value = "阿里矢量图标")
    private String icon;

    @Override
    public SysPermission convertEntity() {
        SysPermission sysPermission=new SysPermission();
        BeanUtils.copyProperties(this,sysPermission);
        return sysPermission;
    }
}
